package eerbaar.shared.internal.tree.commands;

import eerbaar.shared.internal.tree.AbstractNode;
import eerbaar.shared.tree.INode;

public class RemoveAllChildrenCmd {

    public RemoveAllChildrenCmd() {
        //
    }

    public void execute(INode start) {

        while (start.getChildCount() > 0) {
            AbstractNode parent = (AbstractNode) start;
            INode child = start.getChild(0);
            parent.remove(child);
        }

    }

}
